//@author A0097846J
package tasky.ui;

import javax.swing.text.Element;
import javax.swing.text.LabelView;
import javax.swing.text.View;

/**
 * This Class controls the calculations for Word-wrapping for
 * an Element (In Tasky's context, it is the JTextPane)	
 *
 */

public class TextPaneLabelViewWrap extends LabelView {
	
	private static int X_MINSPAN = 0;
	private static String ERROR_INVALIDAXIS = "Invalid axis: ";
	
	public TextPaneLabelViewWrap(Element receivedElement) {
		super(receivedElement);
	}

	public float getMinimumSpan(int axis) {
		switch (axis) {
		case View.X_AXIS:
			return X_MINSPAN;
		case View.Y_AXIS:
			return super.getMinimumSpan(axis);
		default:
			throw new IllegalArgumentException(ERROR_INVALIDAXIS + axis);
		}
	}
}